﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using STLGROUP.Layers.Presentations;
using STLGROUP.Layers.ReportTemplates;
using STLGROUP.Layers.Common;

namespace QuanLyBanHang
{
    public partial class RF005 : frmReportBase
    {
        private int _iDDonHang;


        public RF005()
        {
            InitializeComponent();
            this.Load += new EventHandler(RF005_Load);
        }

        private void RF005_Load(object sender, EventArgs e)
        {
            try
            {
                CR005_CongNoNhaCungCap rp = new CR005_CongNoNhaCungCap();

                var data = Cache.Context.View_CongNoNhaCungCap.Select(s => new { 
                    s.MaNhaCungCap,
                    s.TenNhaCungCap,
                    s.SoDienThoai,
                    s.DiaChi,
                    s.Email,
                    s.CongNo,
                    s.MaDonDatHang,
                    s.NgayThanhToan
                });
               
                rp.SetDataSource(data);

                crystalReportViewer.ReportSource = rp;

            }
            catch (Exception ex)
            {
                UICommon.ShowMessgeString("Xảy ra lỗi trong quá trình xuất báo cáo công nợ "+ex.Message, "Lỗi xuất report");
            }
        }
    }
}
